<!--
 * @Author: hongjianfeng
 * @Date: 2023-08-01 23:45:05
 * @LastEditors: hongjianfeng
 * @LastEditTime: 2023-08-03 00:23:59
 * @Description: 
-->
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>1</title>
    <meta
      name="viewport"
      content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
    />
    <link
      rel="stylesheet"
      type="text/css"
      href="https://lib.baomitu.com/normalize/4.2.0/normalize.min.css"
    />
  </head>

  <body>
    <div id="aaa">111</div>
    <script src="jquery.js"></script>
    <script
      type="text/javascript"
      src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"
    ></script>

    <!-- <span id="musicControl">
      <a id="mc_play" class="on">
        <audio id="musicfx" loop="loop" preload="preload">
          <source
            src="http://139.198.18.134:8084/portal/show/question/doctorIntro.mp3"
            type="audio/mpeg"
            id="hhh"
          />
        </audio>
      </a>
    </span> -->
    <!-- <script>
      var u = navigator.userAgent;
      var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
      if (!isiOS) {
        $("#mc_play").empty();
      } else {
        $("#musicfx").attr("autoplay", "autoplay");
      }

      if (!isiOS) {
        var soundBgm = new Howl({
          src: [
            "http://139.198.18.134:8084/portal/show/question/doctorIntro.mp3",
          ],
          loop: true,
          preload: true,
        });
        // 音频资源 load 之后通过微信桥接触发播放
        soundBgm.on("load", () => {
          (window.WeixinJSBridge &&
            window.WeixinJSBridge.invoke(
              "getNetworkType",
              {},
              () => {
                soundBgm.play();
              },
              false
            )) ||
            soundBgm.play();
        });
      } else {
        var ua = navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == "micromessenger") {
          document.addEventListener("DOMContentLoaded", function () {
            function audioAutoPlay() {
              var audio_ = document.getElementById("musicfx");
              document.addEventListener(
                "WeixinJSBridgeReady",
                function () {
                  audio_.play();
                },
                false
              );
            }
            audioAutoPlay();
          });
        }
      }
    </script> -->
    <!-- <audio
      id="myaudio"
      src="http://139.198.18.134:8084/portal/show/question/doctorIntro.mp3"
      autoplay="autoplay"
      controls="controls"
      preload="preload"
    >
      不支持audio标签
    </audio> -->
    <button id="paly" onclick="voicePaly()">启动</button>
    <script>
      var audio;
      function voicePaly() {
        audio =
          "http://139.198.18.134:8084/portal/show/question/doctorIntro.mp3";
        audio = new Audio(audio);
        // 循环播放，播放结束继续播放
        $(audio)
          .unbind("ended")
          .bind("ended", function () {
            audio.play();
          });
        audio.play();
      }

      window.onload = function () {
        setTimeout(() => {
          // voicePaly();
          $("#paly").click();
        }, 1000);
        // document.getElementById("myaudio").click();
        // var audio = document.createElement("audio");
        // //生成一个audio元素
        // audio.controls = true; //这样控件才能显示出来
        // audio.autoplay = true; //这样控件才能显示出来
        // audio.src =
        //   "http://139.198.18.134:8084/portal/show/question/doctorIntro.mp3"; //音乐的路径
        // // audio.play();
        // document.body.appendChild(audio);
        //   var playAudio = playAudio(
        //   "http://139.198.18.134:8084/portal/show/question/doctorIntro.mp3"
        // );
        // playAudio.play(); //播放
        // function playAudio(url) {
        //   const audio = new Audio(url);
        //   audio.src = url;
        //   audio.play();
        //   return audio;
        // }
      };
    </script>
    <style></style>
  </body>
</html>
